package com.personal.book1.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/p")
public class PropertiesController {
    @Value("${key1}")
    private String key1;

    @Value("key2 5555")
    private String key2;


    @RequestMapping("/getKey1")
    public String getKey1() {
        return "读取配置文件key1：" + key1;
    }

    @RequestMapping("/getKey2")
    public String getKey2() {
        return "读取配置文件key2：" + key2;
    }
}
